package repositories;

import java.util.Collection;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import domain.Evaluation;

@Repository
public interface EvaluationRepository extends JpaRepository<Evaluation, Integer>{

	@Query("select p.evaluations from Participant p where p.id=?1")
	Collection<Evaluation> findEvaluationsByParticipant(int id);
	
	
	//Obtener todas las evaluaciones hechas a una ruta en concreto
	@Query("select r.evaluations from Route r where r.id=?1")
	Collection<Evaluation> findEvaluationsByRoute(int id);
	
}
